package a.autocode.icop.maker;

import java.io.IOException;

public class ICOPServiceMain
{
	/************************
	 * 为了防止错误覆盖文件,
	 * 请先确认是否需要覆盖已存在文件. 
	 * true-覆盖 false-不覆盖.
	 ****************************/
	public static boolean OVERRIDE;
	static {
		OVERRIDE = true;
	}
	
	public static void main(String args[])
	{
		//配置文件读取和文件字符集
		String confpath = "/Users/macbook/Documents/workspace/dolphine/src/a/autocode/icop/maker/icop_autocode.conf";
		
		try
		{
			ICOPServiceMaker maker = new ICOPServiceMaker(confpath,"utf-8");
			maker.override = OVERRIDE;
			maker.doParseConfFile();
			maker.doAutoCode();
			
			//生成service文件.
			maker.generateICOPService();
			maker.doPortFileBackup();			//备份接口文件.
//			XLog.log(JsonCoder.toJsonString(maker.config));
		}
		catch (IOException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
